import java.util.Scanner;

/**
 * 1的个数
 * Created by JiaJia on 2019/4/1 0001.
 */
public class HuaWei041 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        while (sc.hasNext()){
            int num=sc.nextInt();
            System.out.println(numberOfOne(num));
        }
        sc.close();
    }

    private static int numberOfOne(int number){
        int result =0;
        while (number!=0){
            number=number&(number-1);
            result++;
        }
        return result;
    }

}